/*
'===============================================================================
'  Generated From - CSharp_EasyObject_BusinessEntity.vbgen
' 
'  ** IMPORTANT  ** 
'  How to Generate your stored procedures:
' 
'  SQL      = SQL_DAAB_StoredProcs.vbgen
'  
'  This object is 'abstract' which means you need to inherit from it to be able
'  to instantiate it.  This is very easily done. You can override properties and
'  methods in your derived class, this allows you to regenerate this class at any
'  time and not worry about overwriting custom code. 
'
'  NEVER EDIT THIS FILE.
'
'  public class YourObject :  _YourObject
'  {
'
'  }
'
'===============================================================================
*/

// Generated by MyGeneration Version # (1.3.0.3)

using System;
using System.Data;
using System.Data.Common;
using System.Configuration;
using System.Collections;
using System.Collections.Specialized;
using System.Xml;
using System.IO;

using Microsoft.Practices.EnterpriseLibrary.Data;
using NCI.EasyObjects;

namespace CMS.DAL
{

	#region Schema

	public class BannerSchema : NCI.EasyObjects.Schema
	{
		private static ArrayList _entries;
		public static SchemaItem BannerID = new SchemaItem("BannerID", DbType.Int32, true, false, false, true, false, false);
		public static SchemaItem Images = new SchemaItem("Images", DbType.String, SchemaItemJustify.None, 250, true, false, false, false);
		public static SchemaItem Link = new SchemaItem("Link", DbType.String, SchemaItemJustify.None, 250, true, false, false, false);
		public static SchemaItem Title1 = new SchemaItem("Title1", DbType.String, SchemaItemJustify.None, 250, true, false, false, false);
		public static SchemaItem Title2 = new SchemaItem("Title2", DbType.String, SchemaItemJustify.None, 250, true, false, false, false);
		public static SchemaItem TitleColor = new SchemaItem("TitleColor", DbType.StringFixedLength, SchemaItemJustify.None, 10, true, false, false, false);
		public static SchemaItem InitContent1 = new SchemaItem("InitContent1", DbType.String, SchemaItemJustify.None, 1073741823, true, false, false, false);
		public static SchemaItem InitContent2 = new SchemaItem("InitContent2", DbType.String, SchemaItemJustify.None, 1073741823, true, false, false, false);
		public static SchemaItem InitContentColor = new SchemaItem("InitContentColor", DbType.StringFixedLength, SchemaItemJustify.None, 10, true, false, false, false);
		public static SchemaItem Priority = new SchemaItem("Priority", DbType.Int32, false, true, false, false, false, false);
		public static SchemaItem Status = new SchemaItem("Status", DbType.Int32, false, true, false, false, false, false);
		public static SchemaItem BannerType = new SchemaItem("BannerType", DbType.Int32, false, true, false, false, false, false);
		public static SchemaItem TitleFontSize = new SchemaItem("TitleFontSize", DbType.Int32, false, true, false, false, false, false);
		public static SchemaItem InitContentFontSize = new SchemaItem("InitContentFontSize", DbType.Int32, false, true, false, false, false, false);

		public override ArrayList SchemaEntries
		{
			get
			{
				if (_entries == null )
				{
					_entries = new ArrayList();
					_entries.Add(BannerSchema.BannerID);
					_entries.Add(BannerSchema.Images);
					_entries.Add(BannerSchema.Link);
					_entries.Add(BannerSchema.Title1);
					_entries.Add(BannerSchema.Title2);
					_entries.Add(BannerSchema.TitleColor);
					_entries.Add(BannerSchema.InitContent1);
					_entries.Add(BannerSchema.InitContent2);
					_entries.Add(BannerSchema.InitContentColor);
					_entries.Add(BannerSchema.Priority);
					_entries.Add(BannerSchema.Status);
					_entries.Add(BannerSchema.BannerType);
					_entries.Add(BannerSchema.TitleFontSize);
					_entries.Add(BannerSchema.InitContentFontSize);
				}
				return _entries;
			}
		}
		
		public static bool HasAutoKey 
		{
			get { return true;	}
		}

		public static bool HasRowID 
		{
			get { return false;	}
		}
	}
	#endregion

	public abstract class _Banner : EasyObject
	{

		public _Banner()
		{
			BannerSchema _schema = new BannerSchema();
			this.SchemaEntries = _schema.SchemaEntries;
			this.SchemaGlobal = "dbo";
		}
		
		public override void FlushData() 	 
		{ 	 
			this._whereClause = null; 	 
			this._aggregateClause = null; 	 
			base.FlushData(); 	 
		}
			   
		/// <summary>
		/// Loads the business object with info from the database, based on the requested primary key.
		/// </summary>
		/// <param name="BannerID"></param>
		/// <returns>A Boolean indicating success or failure of the query</returns>
		public bool LoadByPrimaryKey(int BannerID)
		{
			switch(this.DefaultCommandType)
			{
				case CommandType.StoredProcedure:
					ListDictionary parameters = new ListDictionary();

					// Add in parameters
					parameters.Add(BannerSchema.BannerID.FieldName, BannerID);

					return base.LoadFromSql(this.SchemaStoredProcedureWithSeparator + "sp_GetBanner", parameters, CommandType.StoredProcedure);

				case CommandType.Text:
					this.Query.ClearAll();
					this.Where.WhereClauseReset();
					this.Where.BannerID.Value = BannerID;
					return this.Query.Load();

				default:
					throw new ArgumentException("Invalid CommandType", "commandType");
			}
		}
	
		/// <summary>
		/// Loads all records from the table.
		/// </summary>
		/// <returns>A Boolean indicating success or failure of the query</returns>
		public bool LoadAll()
		{
			switch(this.DefaultCommandType)
			{
				case CommandType.StoredProcedure:
					return base.LoadFromSql(this.SchemaStoredProcedureWithSeparator + "sp_GetAllBanner", null, CommandType.StoredProcedure);

				case CommandType.Text:
					this.Query.ClearAll();
					this.Where.WhereClauseReset();
					return this.Query.Load();

				default:
					throw new ArgumentException("Invalid CommandType", "commandType");
			}
		}

		/// <summary>
		/// Adds a new record to the internal table.
		/// </summary>
		public override void AddNew()
		{
			base.AddNew();
			this.ApplyDefaults();
		}

		/// <summary>
		/// Apply any default values to columns
		/// </summary>
		protected override void ApplyDefaults()
		{
		}

		protected override DbCommand GetInsertCommand(CommandType commandType)
		{	
			DbCommand dbCommand;

			// Create the Database object, using the default database service. The
			// default database service is determined through configuration.
			Database db = GetDatabase();

			switch(commandType)
			{
				case CommandType.StoredProcedure:
					string sqlCommand = this.SchemaStoredProcedureWithSeparator + "sp_AddBanner";
					dbCommand = db.GetStoredProcCommand(sqlCommand);

					db.AddParameter(dbCommand, "BannerID", DbType.Int32, 0, ParameterDirection.Output, true, 0, 0, "BannerID", DataRowVersion.Default, Convert.DBNull);
					CreateParameters(db, dbCommand);
					
					return dbCommand;

				case CommandType.Text:
					this.Query.ClearAll();
					this.Where.WhereClauseReset();
					foreach(SchemaItem item in this.SchemaEntries)
					{
						if (!item.IsComputed)
						{
							if ((item.IsAutoKey && this.IdentityInsert) || !item.IsAutoKey)
							{
								this.Query.AddInsertColumn(item);
							}
						}
					}
					dbCommand = this.Query.GetInsertCommandWrapper();

					dbCommand.Parameters.Clear();
					if (this.IdentityInsert)
					{
						db.AddInParameter(dbCommand, "BannerID", DbType.Int32, "BannerID", DataRowVersion.Default);
					}
					else
					{
						db.AddParameter(dbCommand, "BannerID", DbType.Int32, 0, ParameterDirection.Output, true, 0, 0, "BannerID", DataRowVersion.Default, Convert.DBNull);
					}
					CreateParameters(db, dbCommand);

					return dbCommand;

				default:
					throw new ArgumentException("Invalid CommandType", "commandType");
			}
		}

		protected override DbCommand GetUpdateCommand(CommandType commandType)
		{
            DbCommand dbCommand;

			// Create the Database object, using the default database service. The
			// default database service is determined through configuration.
			Database db = GetDatabase();

			switch(commandType)
			{
				case CommandType.StoredProcedure:
					string sqlCommand = this.SchemaStoredProcedureWithSeparator + "sp_UpdateBanner";
					dbCommand = db.GetStoredProcCommand(sqlCommand);

					db.AddInParameter(dbCommand, "BannerID", DbType.Int32, "BannerID", DataRowVersion.Current);
					CreateParameters(db, dbCommand);
					
					return dbCommand;

				case CommandType.Text:
					this.Query.ClearAll();
					foreach(SchemaItem item in this.SchemaEntries)
					{
						if (!(item.IsAutoKey || item.IsComputed))
						{
							this.Query.AddUpdateColumn(item);
						}
					}

					this.Where.WhereClauseReset();
					this.Where.BannerID.Operator = WhereParameter.Operand.Equal;
					dbCommand = this.Query.GetUpdateCommandWrapper();

					dbCommand.Parameters.Clear();
					CreateParameters(db, dbCommand);
					db.AddInParameter(dbCommand, "BannerID", DbType.Int32, "BannerID", DataRowVersion.Current);
					
					return dbCommand;

				default:
					throw new ArgumentException("Invalid CommandType", "commandType");
			}
		}

		protected override DbCommand GetDeleteCommand(CommandType commandType)
		{
            DbCommand dbCommand;

			// Create the Database object, using the default database service. The
			// default database service is determined through configuration.
			Database db = GetDatabase();

			switch(commandType)
			{
				case CommandType.StoredProcedure:
					string sqlCommand = this.SchemaStoredProcedureWithSeparator + "sp_DeleteBanner";
					dbCommand = db.GetStoredProcCommand(sqlCommand);
					db.AddInParameter(dbCommand, "BannerID", DbType.Int32, "BannerID", DataRowVersion.Current);
					
					return dbCommand;

				case CommandType.Text:
					this.Query.ClearAll();
					this.Where.WhereClauseReset();
					this.Where.BannerID.Operator = WhereParameter.Operand.Equal;
					dbCommand = this.Query.GetDeleteCommandWrapper();

					dbCommand.Parameters.Clear();
					db.AddInParameter(dbCommand, "BannerID", DbType.Int32, "BannerID", DataRowVersion.Current);
					
					return dbCommand;

				default:
					throw new ArgumentException("Invalid CommandType", "commandType");
			}
		}

		private void CreateParameters(Database db, DbCommand dbCommand)
		{
			db.AddInParameter(dbCommand, "Images", DbType.String, "Images", DataRowVersion.Current);
			db.AddInParameter(dbCommand, "Link", DbType.String, "Link", DataRowVersion.Current);
			db.AddInParameter(dbCommand, "Title1", DbType.String, "Title1", DataRowVersion.Current);
			db.AddInParameter(dbCommand, "Title2", DbType.String, "Title2", DataRowVersion.Current);
			db.AddInParameter(dbCommand, "TitleColor", DbType.StringFixedLength, "TitleColor", DataRowVersion.Current);
			db.AddInParameter(dbCommand, "InitContent1", DbType.String, "InitContent1", DataRowVersion.Current);
			db.AddInParameter(dbCommand, "InitContent2", DbType.String, "InitContent2", DataRowVersion.Current);
			db.AddInParameter(dbCommand, "InitContentColor", DbType.StringFixedLength, "InitContentColor", DataRowVersion.Current);
			db.AddInParameter(dbCommand, "Priority", DbType.Int32, "Priority", DataRowVersion.Current);
			db.AddInParameter(dbCommand, "Status", DbType.Int32, "Status", DataRowVersion.Current);
			db.AddInParameter(dbCommand, "BannerType", DbType.Int32, "BannerType", DataRowVersion.Current);
			db.AddInParameter(dbCommand, "TitleFontSize", DbType.Int32, "TitleFontSize", DataRowVersion.Current);
			db.AddInParameter(dbCommand, "InitContentFontSize", DbType.Int32, "InitContentFontSize", DataRowVersion.Current);
		}
		
		#region Properties
		public virtual int BannerID
		{
			get
			{
				return this.GetInteger(BannerSchema.BannerID.FieldName);
	    	}
			set
			{
				this.SetInteger(BannerSchema.BannerID.FieldName, value);
			}
		}
		public virtual string Images
		{
			get
			{
				return this.GetString(BannerSchema.Images.FieldName);
	    	}
			set
			{
				this.SetString(BannerSchema.Images.FieldName, value);
			}
		}
		public virtual string Link
		{
			get
			{
				return this.GetString(BannerSchema.Link.FieldName);
	    	}
			set
			{
				this.SetString(BannerSchema.Link.FieldName, value);
			}
		}
		public virtual string Title1
		{
			get
			{
				return this.GetString(BannerSchema.Title1.FieldName);
	    	}
			set
			{
				this.SetString(BannerSchema.Title1.FieldName, value);
			}
		}
		public virtual string Title2
		{
			get
			{
				return this.GetString(BannerSchema.Title2.FieldName);
	    	}
			set
			{
				this.SetString(BannerSchema.Title2.FieldName, value);
			}
		}
		public virtual string TitleColor
		{
			get
			{
				return this.GetString(BannerSchema.TitleColor.FieldName);
	    	}
			set
			{
				this.SetString(BannerSchema.TitleColor.FieldName, value);
			}
		}
		public virtual string InitContent1
		{
			get
			{
				return this.GetString(BannerSchema.InitContent1.FieldName);
	    	}
			set
			{
				this.SetString(BannerSchema.InitContent1.FieldName, value);
			}
		}
		public virtual string InitContent2
		{
			get
			{
				return this.GetString(BannerSchema.InitContent2.FieldName);
	    	}
			set
			{
				this.SetString(BannerSchema.InitContent2.FieldName, value);
			}
		}
		public virtual string InitContentColor
		{
			get
			{
				return this.GetString(BannerSchema.InitContentColor.FieldName);
	    	}
			set
			{
				this.SetString(BannerSchema.InitContentColor.FieldName, value);
			}
		}
		public virtual int Priority
		{
			get
			{
				return this.GetInteger(BannerSchema.Priority.FieldName);
	    	}
			set
			{
				this.SetInteger(BannerSchema.Priority.FieldName, value);
			}
		}
		public virtual int Status
		{
			get
			{
				return this.GetInteger(BannerSchema.Status.FieldName);
	    	}
			set
			{
				this.SetInteger(BannerSchema.Status.FieldName, value);
			}
		}
		public virtual int BannerType
		{
			get
			{
				return this.GetInteger(BannerSchema.BannerType.FieldName);
	    	}
			set
			{
				this.SetInteger(BannerSchema.BannerType.FieldName, value);
			}
		}
		public virtual int TitleFontSize
		{
			get
			{
				return this.GetInteger(BannerSchema.TitleFontSize.FieldName);
	    	}
			set
			{
				this.SetInteger(BannerSchema.TitleFontSize.FieldName, value);
			}
		}
		public virtual int InitContentFontSize
		{
			get
			{
				return this.GetInteger(BannerSchema.InitContentFontSize.FieldName);
	    	}
			set
			{
				this.SetInteger(BannerSchema.InitContentFontSize.FieldName, value);
			}
		}

		public override string TableName
		{
			get { return "Banner"; }
		}
		
		#endregion		
		
		#region String Properties
		public virtual string s_BannerID
		{
			get
			{
			    return this.IsColumnNull(BannerSchema.BannerID.FieldName) ? string.Empty : base.GetIntegerAsString(BannerSchema.BannerID.FieldName);
			}
			set
			{
			    if(string.Empty == value)
			        this.SetColumnNull(BannerSchema.BannerID.FieldName);
			    else
			        this.BannerID = base.SetIntegerAsString(BannerSchema.BannerID.FieldName, value);
			}
		}
		public virtual string s_Images
		{
			get
			{
			    return this.IsColumnNull(BannerSchema.Images.FieldName) ? string.Empty : base.GetStringAsString(BannerSchema.Images.FieldName);
			}
			set
			{
			    if(string.Empty == value)
			        this.SetColumnNull(BannerSchema.Images.FieldName);
			    else
			        this.Images = base.SetStringAsString(BannerSchema.Images.FieldName, value);
			}
		}
		public virtual string s_Link
		{
			get
			{
			    return this.IsColumnNull(BannerSchema.Link.FieldName) ? string.Empty : base.GetStringAsString(BannerSchema.Link.FieldName);
			}
			set
			{
			    if(string.Empty == value)
			        this.SetColumnNull(BannerSchema.Link.FieldName);
			    else
			        this.Link = base.SetStringAsString(BannerSchema.Link.FieldName, value);
			}
		}
		public virtual string s_Title1
		{
			get
			{
			    return this.IsColumnNull(BannerSchema.Title1.FieldName) ? string.Empty : base.GetStringAsString(BannerSchema.Title1.FieldName);
			}
			set
			{
			    if(string.Empty == value)
			        this.SetColumnNull(BannerSchema.Title1.FieldName);
			    else
			        this.Title1 = base.SetStringAsString(BannerSchema.Title1.FieldName, value);
			}
		}
		public virtual string s_Title2
		{
			get
			{
			    return this.IsColumnNull(BannerSchema.Title2.FieldName) ? string.Empty : base.GetStringAsString(BannerSchema.Title2.FieldName);
			}
			set
			{
			    if(string.Empty == value)
			        this.SetColumnNull(BannerSchema.Title2.FieldName);
			    else
			        this.Title2 = base.SetStringAsString(BannerSchema.Title2.FieldName, value);
			}
		}
		public virtual string s_TitleColor
		{
			get
			{
			    return this.IsColumnNull(BannerSchema.TitleColor.FieldName) ? string.Empty : base.GetStringAsString(BannerSchema.TitleColor.FieldName);
			}
			set
			{
			    if(string.Empty == value)
			        this.SetColumnNull(BannerSchema.TitleColor.FieldName);
			    else
			        this.TitleColor = base.SetStringAsString(BannerSchema.TitleColor.FieldName, value);
			}
		}
		public virtual string s_InitContent1
		{
			get
			{
			    return this.IsColumnNull(BannerSchema.InitContent1.FieldName) ? string.Empty : base.GetStringAsString(BannerSchema.InitContent1.FieldName);
			}
			set
			{
			    if(string.Empty == value)
			        this.SetColumnNull(BannerSchema.InitContent1.FieldName);
			    else
			        this.InitContent1 = base.SetStringAsString(BannerSchema.InitContent1.FieldName, value);
			}
		}
		public virtual string s_InitContent2
		{
			get
			{
			    return this.IsColumnNull(BannerSchema.InitContent2.FieldName) ? string.Empty : base.GetStringAsString(BannerSchema.InitContent2.FieldName);
			}
			set
			{
			    if(string.Empty == value)
			        this.SetColumnNull(BannerSchema.InitContent2.FieldName);
			    else
			        this.InitContent2 = base.SetStringAsString(BannerSchema.InitContent2.FieldName, value);
			}
		}
		public virtual string s_InitContentColor
		{
			get
			{
			    return this.IsColumnNull(BannerSchema.InitContentColor.FieldName) ? string.Empty : base.GetStringAsString(BannerSchema.InitContentColor.FieldName);
			}
			set
			{
			    if(string.Empty == value)
			        this.SetColumnNull(BannerSchema.InitContentColor.FieldName);
			    else
			        this.InitContentColor = base.SetStringAsString(BannerSchema.InitContentColor.FieldName, value);
			}
		}
		public virtual string s_Priority
		{
			get
			{
			    return this.IsColumnNull(BannerSchema.Priority.FieldName) ? string.Empty : base.GetIntegerAsString(BannerSchema.Priority.FieldName);
			}
			set
			{
			    if(string.Empty == value)
			        this.SetColumnNull(BannerSchema.Priority.FieldName);
			    else
			        this.Priority = base.SetIntegerAsString(BannerSchema.Priority.FieldName, value);
			}
		}
		public virtual string s_Status
		{
			get
			{
			    return this.IsColumnNull(BannerSchema.Status.FieldName) ? string.Empty : base.GetIntegerAsString(BannerSchema.Status.FieldName);
			}
			set
			{
			    if(string.Empty == value)
			        this.SetColumnNull(BannerSchema.Status.FieldName);
			    else
			        this.Status = base.SetIntegerAsString(BannerSchema.Status.FieldName, value);
			}
		}
		public virtual string s_BannerType
		{
			get
			{
			    return this.IsColumnNull(BannerSchema.BannerType.FieldName) ? string.Empty : base.GetIntegerAsString(BannerSchema.BannerType.FieldName);
			}
			set
			{
			    if(string.Empty == value)
			        this.SetColumnNull(BannerSchema.BannerType.FieldName);
			    else
			        this.BannerType = base.SetIntegerAsString(BannerSchema.BannerType.FieldName, value);
			}
		}
		public virtual string s_TitleFontSize
		{
			get
			{
			    return this.IsColumnNull(BannerSchema.TitleFontSize.FieldName) ? string.Empty : base.GetIntegerAsString(BannerSchema.TitleFontSize.FieldName);
			}
			set
			{
			    if(string.Empty == value)
			        this.SetColumnNull(BannerSchema.TitleFontSize.FieldName);
			    else
			        this.TitleFontSize = base.SetIntegerAsString(BannerSchema.TitleFontSize.FieldName, value);
			}
		}
		public virtual string s_InitContentFontSize
		{
			get
			{
			    return this.IsColumnNull(BannerSchema.InitContentFontSize.FieldName) ? string.Empty : base.GetIntegerAsString(BannerSchema.InitContentFontSize.FieldName);
			}
			set
			{
			    if(string.Empty == value)
			        this.SetColumnNull(BannerSchema.InitContentFontSize.FieldName);
			    else
			        this.InitContentFontSize = base.SetIntegerAsString(BannerSchema.InitContentFontSize.FieldName, value);
			}
		}
		#endregion		
	
		#region Where Clause
		public class WhereClause
		{
			public WhereClause(EasyObject entity)
			{
				this._entity = entity;
			}
			
			public TearOffWhereParameter TearOff
			{
				get
				{
					if(_tearOff == null)
					{
						_tearOff = new TearOffWhereParameter(this);
					}

					return _tearOff;
				}
			}

			#region TearOff's
			public class TearOffWhereParameter
			{
				public TearOffWhereParameter(WhereClause clause)
				{
					this._clause = clause;
				}
				
				
				public WhereParameter BannerID
				{
					get
					{
							WhereParameter wp = new WhereParameter(BannerSchema.BannerID);
							this._clause._entity.Query.AddWhereParameter(wp);
							return wp;
					}
				}

				public WhereParameter Images
				{
					get
					{
							WhereParameter wp = new WhereParameter(BannerSchema.Images);
							this._clause._entity.Query.AddWhereParameter(wp);
							return wp;
					}
				}

				public WhereParameter Link
				{
					get
					{
							WhereParameter wp = new WhereParameter(BannerSchema.Link);
							this._clause._entity.Query.AddWhereParameter(wp);
							return wp;
					}
				}

				public WhereParameter Title1
				{
					get
					{
							WhereParameter wp = new WhereParameter(BannerSchema.Title1);
							this._clause._entity.Query.AddWhereParameter(wp);
							return wp;
					}
				}

				public WhereParameter Title2
				{
					get
					{
							WhereParameter wp = new WhereParameter(BannerSchema.Title2);
							this._clause._entity.Query.AddWhereParameter(wp);
							return wp;
					}
				}

				public WhereParameter TitleColor
				{
					get
					{
							WhereParameter wp = new WhereParameter(BannerSchema.TitleColor);
							this._clause._entity.Query.AddWhereParameter(wp);
							return wp;
					}
				}

				public WhereParameter InitContent1
				{
					get
					{
							WhereParameter wp = new WhereParameter(BannerSchema.InitContent1);
							this._clause._entity.Query.AddWhereParameter(wp);
							return wp;
					}
				}

				public WhereParameter InitContent2
				{
					get
					{
							WhereParameter wp = new WhereParameter(BannerSchema.InitContent2);
							this._clause._entity.Query.AddWhereParameter(wp);
							return wp;
					}
				}

				public WhereParameter InitContentColor
				{
					get
					{
							WhereParameter wp = new WhereParameter(BannerSchema.InitContentColor);
							this._clause._entity.Query.AddWhereParameter(wp);
							return wp;
					}
				}

				public WhereParameter Priority
				{
					get
					{
							WhereParameter wp = new WhereParameter(BannerSchema.Priority);
							this._clause._entity.Query.AddWhereParameter(wp);
							return wp;
					}
				}

				public WhereParameter Status
				{
					get
					{
							WhereParameter wp = new WhereParameter(BannerSchema.Status);
							this._clause._entity.Query.AddWhereParameter(wp);
							return wp;
					}
				}

				public WhereParameter BannerType
				{
					get
					{
							WhereParameter wp = new WhereParameter(BannerSchema.BannerType);
							this._clause._entity.Query.AddWhereParameter(wp);
							return wp;
					}
				}

				public WhereParameter TitleFontSize
				{
					get
					{
							WhereParameter wp = new WhereParameter(BannerSchema.TitleFontSize);
							this._clause._entity.Query.AddWhereParameter(wp);
							return wp;
					}
				}

				public WhereParameter InitContentFontSize
				{
					get
					{
							WhereParameter wp = new WhereParameter(BannerSchema.InitContentFontSize);
							this._clause._entity.Query.AddWhereParameter(wp);
							return wp;
					}
				}


				private WhereClause _clause;
			}
			#endregion
		
			public WhereParameter BannerID
		    {
				get
		        {
					if(_BannerID_W == null)
	        	    {
						_BannerID_W = TearOff.BannerID;
					}
					return _BannerID_W;
				}
			}

			public WhereParameter Images
		    {
				get
		        {
					if(_Images_W == null)
	        	    {
						_Images_W = TearOff.Images;
					}
					return _Images_W;
				}
			}

			public WhereParameter Link
		    {
				get
		        {
					if(_Link_W == null)
	        	    {
						_Link_W = TearOff.Link;
					}
					return _Link_W;
				}
			}

			public WhereParameter Title1
		    {
				get
		        {
					if(_Title1_W == null)
	        	    {
						_Title1_W = TearOff.Title1;
					}
					return _Title1_W;
				}
			}

			public WhereParameter Title2
		    {
				get
		        {
					if(_Title2_W == null)
	        	    {
						_Title2_W = TearOff.Title2;
					}
					return _Title2_W;
				}
			}

			public WhereParameter TitleColor
		    {
				get
		        {
					if(_TitleColor_W == null)
	        	    {
						_TitleColor_W = TearOff.TitleColor;
					}
					return _TitleColor_W;
				}
			}

			public WhereParameter InitContent1
		    {
				get
		        {
					if(_InitContent1_W == null)
	        	    {
						_InitContent1_W = TearOff.InitContent1;
					}
					return _InitContent1_W;
				}
			}

			public WhereParameter InitContent2
		    {
				get
		        {
					if(_InitContent2_W == null)
	        	    {
						_InitContent2_W = TearOff.InitContent2;
					}
					return _InitContent2_W;
				}
			}

			public WhereParameter InitContentColor
		    {
				get
		        {
					if(_InitContentColor_W == null)
	        	    {
						_InitContentColor_W = TearOff.InitContentColor;
					}
					return _InitContentColor_W;
				}
			}

			public WhereParameter Priority
		    {
				get
		        {
					if(_Priority_W == null)
	        	    {
						_Priority_W = TearOff.Priority;
					}
					return _Priority_W;
				}
			}

			public WhereParameter Status
		    {
				get
		        {
					if(_Status_W == null)
	        	    {
						_Status_W = TearOff.Status;
					}
					return _Status_W;
				}
			}

			public WhereParameter BannerType
		    {
				get
		        {
					if(_BannerType_W == null)
	        	    {
						_BannerType_W = TearOff.BannerType;
					}
					return _BannerType_W;
				}
			}

			public WhereParameter TitleFontSize
		    {
				get
		        {
					if(_TitleFontSize_W == null)
	        	    {
						_TitleFontSize_W = TearOff.TitleFontSize;
					}
					return _TitleFontSize_W;
				}
			}

			public WhereParameter InitContentFontSize
		    {
				get
		        {
					if(_InitContentFontSize_W == null)
	        	    {
						_InitContentFontSize_W = TearOff.InitContentFontSize;
					}
					return _InitContentFontSize_W;
				}
			}

			private WhereParameter _BannerID_W = null;
			private WhereParameter _Images_W = null;
			private WhereParameter _Link_W = null;
			private WhereParameter _Title1_W = null;
			private WhereParameter _Title2_W = null;
			private WhereParameter _TitleColor_W = null;
			private WhereParameter _InitContent1_W = null;
			private WhereParameter _InitContent2_W = null;
			private WhereParameter _InitContentColor_W = null;
			private WhereParameter _Priority_W = null;
			private WhereParameter _Status_W = null;
			private WhereParameter _BannerType_W = null;
			private WhereParameter _TitleFontSize_W = null;
			private WhereParameter _InitContentFontSize_W = null;

			public void WhereClauseReset()
			{
				_BannerID_W = null;
				_Images_W = null;
				_Link_W = null;
				_Title1_W = null;
				_Title2_W = null;
				_TitleColor_W = null;
				_InitContent1_W = null;
				_InitContent2_W = null;
				_InitContentColor_W = null;
				_Priority_W = null;
				_Status_W = null;
				_BannerType_W = null;
				_TitleFontSize_W = null;
				_InitContentFontSize_W = null;

				this._entity.Query.FlushWhereParameters();

			}
	
			private EasyObject _entity;
			private TearOffWhereParameter _tearOff;
			
		}
	
		public WhereClause Where
		{
			get
			{
				if(_whereClause == null)
				{
					_whereClause = new WhereClause(this);
				}
		
				return _whereClause;
			}
		}
		
		private WhereClause _whereClause = null;	
		#endregion
		
		#region Aggregate Clause
		public class AggregateClause
		{
			public AggregateClause(EasyObject entity)
			{
				this._entity = entity;
			}
			
			public TearOffAggregateParameter TearOff
			{
				get
				{
					if(_tearOff == null)
					{
						_tearOff = new TearOffAggregateParameter(this);
					}

					return _tearOff;
				}
			}

			#region TearOff's
			public class TearOffAggregateParameter
			{
				public TearOffAggregateParameter(AggregateClause clause)
				{
					this._clause = clause;
				}
				
				
				public AggregateParameter BannerID
				{
					get
					{
							AggregateParameter ap = new AggregateParameter(BannerSchema.BannerID);
							this._clause._entity.Query.AddAggregateParameter(ap);
							return ap;
					}
				}

				public AggregateParameter Images
				{
					get
					{
							AggregateParameter ap = new AggregateParameter(BannerSchema.Images);
							this._clause._entity.Query.AddAggregateParameter(ap);
							return ap;
					}
				}

				public AggregateParameter Link
				{
					get
					{
							AggregateParameter ap = new AggregateParameter(BannerSchema.Link);
							this._clause._entity.Query.AddAggregateParameter(ap);
							return ap;
					}
				}

				public AggregateParameter Title1
				{
					get
					{
							AggregateParameter ap = new AggregateParameter(BannerSchema.Title1);
							this._clause._entity.Query.AddAggregateParameter(ap);
							return ap;
					}
				}

				public AggregateParameter Title2
				{
					get
					{
							AggregateParameter ap = new AggregateParameter(BannerSchema.Title2);
							this._clause._entity.Query.AddAggregateParameter(ap);
							return ap;
					}
				}

				public AggregateParameter TitleColor
				{
					get
					{
							AggregateParameter ap = new AggregateParameter(BannerSchema.TitleColor);
							this._clause._entity.Query.AddAggregateParameter(ap);
							return ap;
					}
				}

				public AggregateParameter InitContent1
				{
					get
					{
							AggregateParameter ap = new AggregateParameter(BannerSchema.InitContent1);
							this._clause._entity.Query.AddAggregateParameter(ap);
							return ap;
					}
				}

				public AggregateParameter InitContent2
				{
					get
					{
							AggregateParameter ap = new AggregateParameter(BannerSchema.InitContent2);
							this._clause._entity.Query.AddAggregateParameter(ap);
							return ap;
					}
				}

				public AggregateParameter InitContentColor
				{
					get
					{
							AggregateParameter ap = new AggregateParameter(BannerSchema.InitContentColor);
							this._clause._entity.Query.AddAggregateParameter(ap);
							return ap;
					}
				}

				public AggregateParameter Priority
				{
					get
					{
							AggregateParameter ap = new AggregateParameter(BannerSchema.Priority);
							this._clause._entity.Query.AddAggregateParameter(ap);
							return ap;
					}
				}

				public AggregateParameter Status
				{
					get
					{
							AggregateParameter ap = new AggregateParameter(BannerSchema.Status);
							this._clause._entity.Query.AddAggregateParameter(ap);
							return ap;
					}
				}

				public AggregateParameter BannerType
				{
					get
					{
							AggregateParameter ap = new AggregateParameter(BannerSchema.BannerType);
							this._clause._entity.Query.AddAggregateParameter(ap);
							return ap;
					}
				}

				public AggregateParameter TitleFontSize
				{
					get
					{
							AggregateParameter ap = new AggregateParameter(BannerSchema.TitleFontSize);
							this._clause._entity.Query.AddAggregateParameter(ap);
							return ap;
					}
				}

				public AggregateParameter InitContentFontSize
				{
					get
					{
							AggregateParameter ap = new AggregateParameter(BannerSchema.InitContentFontSize);
							this._clause._entity.Query.AddAggregateParameter(ap);
							return ap;
					}
				}


				private AggregateClause _clause;
			}
			#endregion
		
			public AggregateParameter BannerID
		    {
				get
		        {
					if(_BannerID_W == null)
	        	    {
						_BannerID_W = TearOff.BannerID;
					}
					return _BannerID_W;
				}
			}

			public AggregateParameter Images
		    {
				get
		        {
					if(_Images_W == null)
	        	    {
						_Images_W = TearOff.Images;
					}
					return _Images_W;
				}
			}

			public AggregateParameter Link
		    {
				get
		        {
					if(_Link_W == null)
	        	    {
						_Link_W = TearOff.Link;
					}
					return _Link_W;
				}
			}

			public AggregateParameter Title1
		    {
				get
		        {
					if(_Title1_W == null)
	        	    {
						_Title1_W = TearOff.Title1;
					}
					return _Title1_W;
				}
			}

			public AggregateParameter Title2
		    {
				get
		        {
					if(_Title2_W == null)
	        	    {
						_Title2_W = TearOff.Title2;
					}
					return _Title2_W;
				}
			}

			public AggregateParameter TitleColor
		    {
				get
		        {
					if(_TitleColor_W == null)
	        	    {
						_TitleColor_W = TearOff.TitleColor;
					}
					return _TitleColor_W;
				}
			}

			public AggregateParameter InitContent1
		    {
				get
		        {
					if(_InitContent1_W == null)
	        	    {
						_InitContent1_W = TearOff.InitContent1;
					}
					return _InitContent1_W;
				}
			}

			public AggregateParameter InitContent2
		    {
				get
		        {
					if(_InitContent2_W == null)
	        	    {
						_InitContent2_W = TearOff.InitContent2;
					}
					return _InitContent2_W;
				}
			}

			public AggregateParameter InitContentColor
		    {
				get
		        {
					if(_InitContentColor_W == null)
	        	    {
						_InitContentColor_W = TearOff.InitContentColor;
					}
					return _InitContentColor_W;
				}
			}

			public AggregateParameter Priority
		    {
				get
		        {
					if(_Priority_W == null)
	        	    {
						_Priority_W = TearOff.Priority;
					}
					return _Priority_W;
				}
			}

			public AggregateParameter Status
		    {
				get
		        {
					if(_Status_W == null)
	        	    {
						_Status_W = TearOff.Status;
					}
					return _Status_W;
				}
			}

			public AggregateParameter BannerType
		    {
				get
		        {
					if(_BannerType_W == null)
	        	    {
						_BannerType_W = TearOff.BannerType;
					}
					return _BannerType_W;
				}
			}

			public AggregateParameter TitleFontSize
		    {
				get
		        {
					if(_TitleFontSize_W == null)
	        	    {
						_TitleFontSize_W = TearOff.TitleFontSize;
					}
					return _TitleFontSize_W;
				}
			}

			public AggregateParameter InitContentFontSize
		    {
				get
		        {
					if(_InitContentFontSize_W == null)
	        	    {
						_InitContentFontSize_W = TearOff.InitContentFontSize;
					}
					return _InitContentFontSize_W;
				}
			}

			private AggregateParameter _BannerID_W = null;
			private AggregateParameter _Images_W = null;
			private AggregateParameter _Link_W = null;
			private AggregateParameter _Title1_W = null;
			private AggregateParameter _Title2_W = null;
			private AggregateParameter _TitleColor_W = null;
			private AggregateParameter _InitContent1_W = null;
			private AggregateParameter _InitContent2_W = null;
			private AggregateParameter _InitContentColor_W = null;
			private AggregateParameter _Priority_W = null;
			private AggregateParameter _Status_W = null;
			private AggregateParameter _BannerType_W = null;
			private AggregateParameter _TitleFontSize_W = null;
			private AggregateParameter _InitContentFontSize_W = null;

			public void AggregateClauseReset()
			{
				_BannerID_W = null;
				_Images_W = null;
				_Link_W = null;
				_Title1_W = null;
				_Title2_W = null;
				_TitleColor_W = null;
				_InitContent1_W = null;
				_InitContent2_W = null;
				_InitContentColor_W = null;
				_Priority_W = null;
				_Status_W = null;
				_BannerType_W = null;
				_TitleFontSize_W = null;
				_InitContentFontSize_W = null;

				this._entity.Query.FlushAggregateParameters();

			}
	
			private EasyObject _entity;
			private TearOffAggregateParameter _tearOff;
			
		}
	
		public AggregateClause Aggregate
		{
			get
			{
				if(_aggregateClause == null)
				{
					_aggregateClause = new AggregateClause(this);
				}
		
				return _aggregateClause;
			}
		}
		
		private AggregateClause _aggregateClause = null;	
		#endregion
	}
}
